From 4dce6a59aac3dbc7eee4ee3bff482f0de831d497 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sat, 21 Oct 2017 14:25:21 +0100 Subject: TravisCI: Add osx builds --- .travis.yml | 16 ++++++++++++++++ CIbuild.sh | 14 +++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 104722267..759de03f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,19 @@ language: cpp sudo: false +os: +- linux +- osx + compiler: - clang - gcc +matrix: + exclude: + - os: osx + compiler: gcc + addons: apt: sources: @@ -13,6 +22,13 @@ addons: - g++-4.8 - gdb + +before_script: +- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then + brew update; + brew install gdb; + fi + script: ./CIbuild.sh env: diff --git a/CIbuild.sh b/CIbuild.sh index 2bfe2036d..f152a15e1 100755 --- a/CIbuild.sh +++ b/CIbuild.sh @@ -14,17 +14,25 @@ fi cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1; echo "Building..." -make -j 2; -make -j 2 test ARGS="-V"; +cmake --build . -- -j 2; +ctest -j 2 -V; # Create .gdbinit in home directory. Switches off the confirmation on quit echo -e "define hook-quit\n\tset confirm off\nend\n" > ~/.gdbinit echo "Testing..." + +# OSX builds need sudo because gdb isn't signed +if [ "$TRAVIS_OS_NAME" = osx ]; then + GDB_COMMAND="sudo gdb" +else + GDB_COMMAND="gdb" +fi + cd Server/; touch apiCheckFailed.flag if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then - gdb -return-child-result -ex run -ex "bt" -ex "info threads" -ex "thread apply all bt" -ex "quit" --args $CUBERITE_PATH << EOF + ${GDB_COMMAND} -return-child-result -ex run -ex "bt" -ex "info threads" -ex "thread apply all bt" -ex "quit" --args $CUBERITE_PATH << EOF load APIDump apicheck restart -- cgit v1.2.3